package com.bitcola.security.admin.mapper;


import com.bitcola.security.common.util.AdminQuery;
import com.bitcola.entity.ColaCoin;
import com.bitcola.entity.ColaMeBalance;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 币种表
 * 
 * @author Mr.AG
 * @email 463540703@qq.com
 * @date 2018-08-01 09:03:17
 */
@Repository
public interface ColaCoinMapper extends Mapper<ColaCoin> {


    List<Map<String, Object>> coinApply(AdminQuery query);

    Long countCoinApply(AdminQuery query);

    void insertCoinEosToken(@Param("coinCode") String coinCode, @Param("tokenName")String tokenName,
                            @Param("symbol") String symbol,@Param("precision") int precision);

    void insertCoinEthToken(@Param("coinCode")String coinCode, @Param("contract")String contract,
                            @Param("minAutoTransferToHot") BigDecimal minAutoTransferToHot);

    List<Map<String, Object>> eosTokenList();

    List<Map<String, Object>> ethTokenList();

    void insertCoinXlmToken(@Param("coinCode")String coinCode, @Param("tokenCode")String tokenCode, @Param("tokenIssuer")String tokenIssuer);

    List<Map<String, Object>> xlmTokenList();

    /**
     * 获取所有币种名称
     * @return
     */
    List<String> findAllCoin();

    /**
     * 获取代币列表
     * @return
     */
    List<ColaCoin> coins();

    /**
     * 详情
     * @param id
     * @return
     */
    ColaCoin findByCondition(@Param("id") String id);

    /**
     * 添加钱包
     * @param entity
     * @param balanceKey
     */
    void insertBalance(@Param("entity") ColaMeBalance entity, @Param("key") String balanceKey);
}
